package com.ruoyi.project.jiaqin.industry.service.impl;

import java.util.List;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.jiaqin.industry.mapper.JiaqinIndustryMapper;
import com.ruoyi.project.jiaqin.industry.domain.JiaqinIndustry;
import com.ruoyi.project.jiaqin.industry.service.IJiaqinIndustryService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 行业Service业务层处理
 *
 * @author admin
 * @date 2020-12-30
 */
@Service("jiaqinIndustryService")
public class JiaqinIndustryServiceImpl implements IJiaqinIndustryService
{
    @Autowired
    private JiaqinIndustryMapper jiaqinIndustryMapper;

    /**
     * 查询行业
     *
     * @param id 行业ID
     * @return 行业
     */
    @Override
    public JiaqinIndustry selectJiaqinIndustryById(String id)
    {
        return jiaqinIndustryMapper.selectJiaqinIndustryById(id);
    }

    /**
     * 查询行业列表
     *
     * @param jiaqinIndustry 行业
     * @return 行业
     */
    @Override
    public List<JiaqinIndustry> selectJiaqinIndustryList(JiaqinIndustry jiaqinIndustry)
    {
        return jiaqinIndustryMapper.selectJiaqinIndustryList(jiaqinIndustry);
    }
    /**
     * 查询行业列表
     *
     * @param jiaqinIndustry 行业
     * @return 行业
     */
    @Override
    public List<JiaqinIndustry> selectJiaqinIndustryList()
    {
        return jiaqinIndustryMapper.selectJiaqinIndustryList(new JiaqinIndustry());
    }
    /**
     * 新增行业
     *
     * @param jiaqinIndustry 行业
     * @return 结果
     */
    @Override
    public int insertJiaqinIndustry(JiaqinIndustry jiaqinIndustry)
    {
        jiaqinIndustry.setId(UUID.randomUUID().toString().replace("-",""));
        return jiaqinIndustryMapper.insertJiaqinIndustry(jiaqinIndustry);
    }

    /**
     * 修改行业
     *
     * @param jiaqinIndustry 行业
     * @return 结果
     */
    @Override
    public int updateJiaqinIndustry(JiaqinIndustry jiaqinIndustry)
    {
        return jiaqinIndustryMapper.updateJiaqinIndustry(jiaqinIndustry);
    }

    /**
     * 删除行业对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJiaqinIndustryByIds(String ids)
    {
        return jiaqinIndustryMapper.deleteJiaqinIndustryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除行业信息
     *
     * @param id 行业ID
     * @return 结果
     */
    @Override
    public int deleteJiaqinIndustryById(String id)
    {
        return jiaqinIndustryMapper.deleteJiaqinIndustryById(id);
    }
}
